package com.cjl.android.handlerthread;

import com.cjl.android.handler.Handler;
import com.cjl.android.handler.Message;

public class Test {
    public static void main(String[] args) {
        HandlerThread handlerThread = new HandlerThread("MyhandlerThread"){
            @Override
            protected void onLooperPrepared() {
                System.out.println("Test.onLooperPrepared");
            }
        };
        handlerThread.start();

        Handler handler = new Handler(handlerThread.getLooper()){
            @Override
            public void handleMessage(Message msg) {
                System.out.println("Test.handleMessage msg "+msg);
            }
        };

        handler.sendMessage(new Message("test1"));

    }

}
